package com.xuyiwei.mayi.test;

import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;

/**
 * Created by xuyiwei on 2019/4/13.
 */
public class TCPClient {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1",8080);
        OutputStream os = socket.getOutputStream();
        for(int i=0;i<10;i++){
            os.write(("你好呀"+i).getBytes());
        }
        os.close();
        socket.close();
    }
}
